<template>
  <div>
    <div>
      <h1>波浪loading</h1>
    </div>
    <div class="loading">
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
      <div></div>
    </div>
  </div>
</template>

<script>
export default {
  name: "WaveLoading"
}
</script>

<style scoped lang="scss">
.loading{
  display: flex;
  width: 120px;
  height: 100px;
  align-items: center; /*控制是否是中间开始*/
  div{
    width: 20px;
    background-color: red;
    height: 0;
    margin-left: 6px;
    &:first-of-type{
      margin-left: 0px;
    }
    @for $i from 1 through 6 {
      @keyframes waveLoading {
        0%{
          height: 0;
        }
        100%{
          height: 100%;
        }
      }
      &:nth-of-type(#{$i}){
        animation-direction: alternate;
        animation-iteration-count: infinite;
        animation-name: waveLoading;
        animation-delay: #{0.1*$i}s;
        animation-duration: 0.5s;
      }
    }
  }
}
</style>
